package service.impl;

import dao.RentDao;
import dao.impl.RentDaoImpl;
import entity.Rent;
import service.RentService;

import java.util.List;

public class RentServiceImpl implements RentService {
    RentDao rentDao=new RentDaoImpl();
    @Override
    public List<Rent> findall() {
        try {
            return rentDao.findall();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public Rent findbycarNum(String carNum) {
        try {
            return rentDao.findbycarNum(carNum);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public int add(Rent rent) {
        try {
            return rentDao.add(rent);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public int update(Rent rent) {
        try {
            return rentDao.update(rent);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
